\(\int \frac {(A+B \log (e (\frac {a+b x}{c+d x})^n))^2}{(a g+b g x)^3} \, dx\) [16]

   Optimal result
   Rubi [A] (verified)
   Mathematica [C] (verified)
   Maple [B] (verified)
   Fricas [B] (verification not implemented)
   Sympy [F]
   Maxima [B] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 35, antiderivative size = 288 \[ \int \frac {\left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )^2}{(a g+b g x)^3} \, dx=\frac {2 B^2 d n^2 (c+d x)}{(b c-a d)^2 g^3 (a+b x)}-\frac {b B^2 n^2 (c+d x)^2}{4 (b c-a d)^2 g^3 (a+b x)^2}+\frac {2 B d n (c+d x) \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )}{(b c-a d)^2 g^3 (a+b x)}-\frac {b B n (c+d x)^2 \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )}{2 (b c-a d)^2 g^3 (a+b x)^2}+\frac {d (c+d x) \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )^2}{(b c-a d)^2 g^3 (a+b x)}-\frac {b (c+d x)^2 \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )^2}{2 (b c-a d)^2 g^3 (a+b x)^2} \]

[Out]

2*B^2*d*n^2*(d*x+c)/(-a*d+b*c)^2/g^3/(b*x+a)-1/4*b*B^2*n^2*(d*x+c)^2/(-a*d+b*c)^2/g^3/(b*x+a)^2+2*B*d*n*(d*x+c
)*(A+B*ln(e*((b*x+a)/(d*x+c))^n))/(-a*d+b*c)^2/g^3/(b*x+a)-1/2*b*B*n*(d*x+c)^2*(A+B*ln(e*((b*x+a)/(d*x+c))^n))
/(-a*d+b*c)^2/g^3/(b*x+a)^2+d*(d*x+c)*(A+B*ln(e*((b*x+a)/(d*x+c))^n))^2/(-a*d+b*c)^2/g^3/(b*x+a)-1/2*b*(d*x+c)
^2*(A+B*ln(e*((b*x+a)/(d*x+c))^n))^2/(-a*d+b*c)^2/g^3/(b*x+a)^2

Rubi [A] (verified)

Time = 0.15 (sec) , antiderivative size = 288, normalized size of antiderivative = 1.00, number of steps used = 7, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.114, Rules used = {2549, 2395, 2342, 2341} \[ \int \frac {\left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )^2}{(a g+b g x)^3} \, dx=-\frac {b B n (c+d x)^2 \left (B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )+A\right )}{2 g^3 (a+b x)^2 (b c-a d)^2}+\frac {2 B d n (c+d x) \left (B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )+A\right )}{g^3 (a+b x) (b c-a d)^2}-\frac {b (c+d x)^2 \left (B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )+A\right )^2}{2 g^3 (a+b x)^2 (b c-a d)^2}+\frac {d (c+d x) \left (B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )+A\right )^2}{g^3 (a+b x) (b c-a d)^2}-\frac {b B^2 n^2 (c+d x)^2}{4 g^3 (a+b x)^2 (b c-a d)^2}+\frac {2 B^2 d n^2 (c+d x)}{g^3 (a+b x) (b c-a d)^2} \]

[In]

Int[(A + B*Log[e*((a + b*x)/(c + d*x))^n])^2/(a*g + b*g*x)^3,x]

[Out]

(2*B^2*d*n^2*(c + d*x))/((b*c - a*d)^2*g^3*(a + b*x)) - (b*B^2*n^2*(c + d*x)^2)/(4*(b*c - a*d)^2*g^3*(a + b*x)
^2) + (2*B*d*n*(c + d*x)*(A + B*Log[e*((a + b*x)/(c + d*x))^n]))/((b*c - a*d)^2*g^3*(a + b*x)) - (b*B*n*(c + d
*x)^2*(A + B*Log[e*((a + b*x)/(c + d*x))^n]))/(2*(b*c - a*d)^2*g^3*(a + b*x)^2) + (d*(c + d*x)*(A + B*Log[e*((
a + b*x)/(c + d*x))^n])^2)/((b*c - a*d)^2*g^3*(a + b*x)) - (b*(c + d*x)^2*(A + B*Log[e*((a + b*x)/(c + d*x))^n
])^2)/(2*(b*c - a*d)^2*g^3*(a + b*x)^2)

Rule 2341

Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))*((d_.)*(x_))^(m_.), x_Symbol] :> Simp[(d*x)^(m + 1)*((a + b*Log[c*x^
n])/(d*(m + 1))), x] - Simp[b*n*((d*x)^(m + 1)/(d*(m + 1)^2)), x] /; FreeQ[{a, b, c, d, m, n}, x] && NeQ[m, -1
]

Rule 2342

Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))^(p_.)*((d_.)*(x_))^(m_.), x_Symbol] :> Simp[(d*x)^(m + 1)*((a + b*Lo
g[c*x^n])^p/(d*(m + 1))), x] - Dist[b*n*(p/(m + 1)), Int[(d*x)^m*(a + b*Log[c*x^n])^(p - 1), x], x] /; FreeQ[{
a, b, c, d, m, n}, x] && NeQ[m, -1] && GtQ[p, 0]

Rule 2395

Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))^(p_.)*((f_.)*(x_))^(m_.)*((d_) + (e_.)*(x_)^(r_.))^(q_.), x_Symbol]
:> With[{u = ExpandIntegrand[(a + b*Log[c*x^n])^p, (f*x)^m*(d + e*x^r)^q, x]}, Int[u, x] /; SumQ[u]] /; FreeQ[
{a, b, c, d, e, f, m, n, p, q, r}, x] && IntegerQ[q] && (GtQ[q, 0] || (IGtQ[p, 0] && IntegerQ[m] && IntegerQ[r
]))

Rule 2549

Int[((A_.) + Log[(e_.)*(((a_.) + (b_.)*(x_))/((c_.) + (d_.)*(x_)))^(n_.)]*(B_.))^(p_.)*((f_.) + (g_.)*(x_))^(m
_.), x_Symbol] :> Dist[(b*c - a*d)^(m + 1)*(g/b)^m, Subst[Int[x^m*((A + B*Log[e*x^n])^p/(b - d*x)^(m + 2)), x]
, x, (a + b*x)/(c + d*x)], x] /; FreeQ[{a, b, c, d, e, f, g, A, B, n}, x] && NeQ[b*c - a*d, 0] && IntegersQ[m,
 p] && EqQ[b*f - a*g, 0] && (GtQ[p, 0] || LtQ[m, -1])

Rubi steps \begin{align*} \text {integral}& = \frac {\text {Subst}\left (\int \frac {(b-d x) \left (A+B \log \left (e x^n\right )\right )^2}{x^3} \, dx,x,\frac {a+b x}{c+d x}\right )}{(b c-a d)^2 g^3} \\ & = \frac {\text {Subst}\left (\int \left (\frac {b \left (A+B \log \left (e x^n\right )\right )^2}{x^3}-\frac {d \left (A+B \log \left (e x^n\right )\right )^2}{x^2}\right ) \, dx,x,\frac {a+b x}{c+d x}\right )}{(b c-a d)^2 g^3} \\ & = \frac {b \text {Subst}\left (\int \frac {\left (A+B \log \left (e x^n\right )\right )^2}{x^3} \, dx,x,\frac {a+b x}{c+d x}\right )}{(b c-a d)^2 g^3}-\frac {d \text {Subst}\left (\int \frac {\left (A+B \log \left (e x^n\right )\right )^2}{x^2} \, dx,x,\frac {a+b x}{c+d x}\right )}{(b c-a d)^2 g^3} \\ & = \frac {d (c+d x) \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )^2}{(b c-a d)^2 g^3 (a+b x)}-\frac {b (c+d x)^2 \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )^2}{2 (b c-a d)^2 g^3 (a+b x)^2}+\frac {(b B n) \text {Subst}\left (\int \frac {A+B \log \left (e x^n\right )}{x^3} \, dx,x,\frac {a+b x}{c+d x}\right )}{(b c-a d)^2 g^3}-\frac {(2 B d n) \text {Subst}\left (\int \frac {A+B \log \left (e x^n\right )}{x^2} \, dx,x,\frac {a+b x}{c+d x}\right )}{(b c-a d)^2 g^3} \\ & = \frac {2 B^2 d n^2 (c+d x)}{(b c-a d)^2 g^3 (a+b x)}-\frac {b B^2 n^2 (c+d x)^2}{4 (b c-a d)^2 g^3 (a+b x)^2}+\frac {2 B d n (c+d x) \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )}{(b c-a d)^2 g^3 (a+b x)}-\frac {b B n (c+d x)^2 \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )}{2 (b c-a d)^2 g^3 (a+b x)^2}+\frac {d (c+d x) \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )^2}{(b c-a d)^2 g^3 (a+b x)}-\frac {b (c+d x)^2 \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )^2}{2 (b c-a d)^2 g^3 (a+b x)^2} \\ \end{align*}

Mathematica [C] (verified)

Result contains higher order function than in optimal. Order 4 vs. order 3 in optimal.

Time = 0.29 (sec) , antiderivative size = 463, normalized size of antiderivative = 1.61 \[ \int \frac {\left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )^2}{(a g+b g x)^3} \, dx=-\frac {2 \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )^2+\frac {B n \left (2 (b c-a d)^2 \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )+4 d (-b c+a d) (a+b x) \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )-4 d^2 (a+b x)^2 \log (a+b x) \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )+4 d^2 (a+b x)^2 \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right ) \log (c+d x)-4 B d n (a+b x) (b c-a d+d (a+b x) \log (a+b x)-d (a+b x) \log (c+d x))+B n \left ((b c-a d)^2+2 d (-b c+a d) (a+b x)-2 d^2 (a+b x)^2 \log (a+b x)+2 d^2 (a+b x)^2 \log (c+d x)\right )+2 B d^2 n (a+b x)^2 \left (\log (a+b x) \left (\log (a+b x)-2 \log \left (\frac {b (c+d x)}{b c-a d}\right )\right )-2 \operatorname {PolyLog}\left (2,\frac {d (a+b x)}{-b c+a d}\right )\right )-2 B d^2 n (a+b x)^2 \left (\left (2 \log \left (\frac {d (a+b x)}{-b c+a d}\right )-\log (c+d x)\right ) \log (c+d x)+2 \operatorname {PolyLog}\left (2,\frac {b (c+d x)}{b c-a d}\right )\right )\right )}{(b c-a d)^2}}{4 b g^3 (a+b x)^2} \]

[In]

Integrate[(A + B*Log[e*((a + b*x)/(c + d*x))^n])^2/(a*g + b*g*x)^3,x]

[Out]

-1/4*(2*(A + B*Log[e*((a + b*x)/(c + d*x))^n])^2 + (B*n*(2*(b*c - a*d)^2*(A + B*Log[e*((a + b*x)/(c + d*x))^n]
) + 4*d*(-(b*c) + a*d)*(a + b*x)*(A + B*Log[e*((a + b*x)/(c + d*x))^n]) - 4*d^2*(a + b*x)^2*Log[a + b*x]*(A +
B*Log[e*((a + b*x)/(c + d*x))^n]) + 4*d^2*(a + b*x)^2*(A + B*Log[e*((a + b*x)/(c + d*x))^n])*Log[c + d*x] - 4*
B*d*n*(a + b*x)*(b*c - a*d + d*(a + b*x)*Log[a + b*x] - d*(a + b*x)*Log[c + d*x]) + B*n*((b*c - a*d)^2 + 2*d*(
-(b*c) + a*d)*(a + b*x) - 2*d^2*(a + b*x)^2*Log[a + b*x] + 2*d^2*(a + b*x)^2*Log[c + d*x]) + 2*B*d^2*n*(a + b*
x)^2*(Log[a + b*x]*(Log[a + b*x] - 2*Log[(b*(c + d*x))/(b*c - a*d)]) - 2*PolyLog[2, (d*(a + b*x))/(-(b*c) + a*
d)]) - 2*B*d^2*n*(a + b*x)^2*((2*Log[(d*(a + b*x))/(-(b*c) + a*d)] - Log[c + d*x])*Log[c + d*x] + 2*PolyLog[2,
 (b*(c + d*x))/(b*c - a*d)])))/(b*c - a*d)^2)/(b*g^3*(a + b*x)^2)

Maple [B] (verified)

Leaf count of result is larger than twice the leaf count of optimal. \(671\) vs. \(2(282)=564\).

Time = 7.39 (sec) , antiderivative size = 672, normalized size of antiderivative = 2.33

method result size
parallelrisch \(-\frac {7 B^{2} a^{2} b^{3} d^{3} n^{3}+B^{2} b^{5} c^{2} d \,n^{3}+2 A^{2} a^{2} b^{3} d^{3} n +2 A^{2} b^{5} c^{2} d n -8 A B \ln \left (e \left (\frac {b x +a}{d x +c}\right )^{n}\right ) a \,b^{4} c \,d^{2} n -8 A B a \,b^{4} c \,d^{2} n^{2}+4 A B x a \,b^{4} d^{3} n^{2}-4 A B x \,b^{5} c \,d^{2} n^{2}-4 B^{2} \ln \left (e \left (\frac {b x +a}{d x +c}\right )^{n}\right )^{2} a \,b^{4} c \,d^{2} n -8 B^{2} \ln \left (e \left (\frac {b x +a}{d x +c}\right )^{n}\right ) a \,b^{4} c \,d^{2} n^{2}+4 A B \ln \left (e \left (\frac {b x +a}{d x +c}\right )^{n}\right ) b^{5} c^{2} d n -4 A B \,x^{2} \ln \left (e \left (\frac {b x +a}{d x +c}\right )^{n}\right ) b^{5} d^{3} n -4 B^{2} x \ln \left (e \left (\frac {b x +a}{d x +c}\right )^{n}\right )^{2} a \,b^{4} d^{3} n -8 B^{2} x \ln \left (e \left (\frac {b x +a}{d x +c}\right )^{n}\right ) a \,b^{4} d^{3} n^{2}-4 B^{2} x \ln \left (e \left (\frac {b x +a}{d x +c}\right )^{n}\right ) b^{5} c \,d^{2} n^{2}-8 A B x \ln \left (e \left (\frac {b x +a}{d x +c}\right )^{n}\right ) a \,b^{4} d^{3} n -2 B^{2} x^{2} \ln \left (e \left (\frac {b x +a}{d x +c}\right )^{n}\right )^{2} b^{5} d^{3} n -6 B^{2} x^{2} \ln \left (e \left (\frac {b x +a}{d x +c}\right )^{n}\right ) b^{5} d^{3} n^{2}+6 B^{2} x a \,b^{4} d^{3} n^{3}-6 B^{2} x \,b^{5} c \,d^{2} n^{3}+2 B^{2} \ln \left (e \left (\frac {b x +a}{d x +c}\right )^{n}\right )^{2} b^{5} c^{2} d n +2 B^{2} \ln \left (e \left (\frac {b x +a}{d x +c}\right )^{n}\right ) b^{5} c^{2} d \,n^{2}-8 B^{2} a \,b^{4} c \,d^{2} n^{3}+6 A B \,a^{2} b^{3} d^{3} n^{2}+2 A B \,b^{5} c^{2} d \,n^{2}-4 A^{2} a \,b^{4} c \,d^{2} n}{4 g^{3} \left (b x +a \right )^{2} \left (a^{2} d^{2}-2 a b c d +b^{2} c^{2}\right ) b^{4} d n}\) \(672\)

[In]

int((A+B*ln(e*((b*x+a)/(d*x+c))^n))^2/(b*g*x+a*g)^3,x,method=_RETURNVERBOSE)

[Out]

-1/4*(7*B^2*a^2*b^3*d^3*n^3+B^2*b^5*c^2*d*n^3+2*A^2*a^2*b^3*d^3*n+2*A^2*b^5*c^2*d*n-8*A*B*ln(e*((b*x+a)/(d*x+c
))^n)*a*b^4*c*d^2*n-8*A*B*a*b^4*c*d^2*n^2+4*A*B*x*a*b^4*d^3*n^2-4*A*B*x*b^5*c*d^2*n^2-4*B^2*ln(e*((b*x+a)/(d*x
+c))^n)^2*a*b^4*c*d^2*n-8*B^2*ln(e*((b*x+a)/(d*x+c))^n)*a*b^4*c*d^2*n^2+4*A*B*ln(e*((b*x+a)/(d*x+c))^n)*b^5*c^
2*d*n-4*A*B*x^2*ln(e*((b*x+a)/(d*x+c))^n)*b^5*d^3*n-4*B^2*x*ln(e*((b*x+a)/(d*x+c))^n)^2*a*b^4*d^3*n-8*B^2*x*ln
(e*((b*x+a)/(d*x+c))^n)*a*b^4*d^3*n^2-4*B^2*x*ln(e*((b*x+a)/(d*x+c))^n)*b^5*c*d^2*n^2-8*A*B*x*ln(e*((b*x+a)/(d
*x+c))^n)*a*b^4*d^3*n-2*B^2*x^2*ln(e*((b*x+a)/(d*x+c))^n)^2*b^5*d^3*n-6*B^2*x^2*ln(e*((b*x+a)/(d*x+c))^n)*b^5*
d^3*n^2+6*B^2*x*a*b^4*d^3*n^3-6*B^2*x*b^5*c*d^2*n^3+2*B^2*ln(e*((b*x+a)/(d*x+c))^n)^2*b^5*c^2*d*n+2*B^2*ln(e*(
(b*x+a)/(d*x+c))^n)*b^5*c^2*d*n^2-8*B^2*a*b^4*c*d^2*n^3+6*A*B*a^2*b^3*d^3*n^2+2*A*B*b^5*c^2*d*n^2-4*A^2*a*b^4*
c*d^2*n)/g^3/(b*x+a)^2/(a^2*d^2-2*a*b*c*d+b^2*c^2)/b^4/d/n

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 651 vs. \(2 (282) = 564\).

Time = 0.29 (sec) , antiderivative size = 651, normalized size of antiderivative = 2.26 \[ \int \frac {\left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )^2}{(a g+b g x)^3} \, dx=-\frac {2 \, A^{2} b^{2} c^{2} - 4 \, A^{2} a b c d + 2 \, A^{2} a^{2} d^{2} + {\left (B^{2} b^{2} c^{2} - 8 \, B^{2} a b c d + 7 \, B^{2} a^{2} d^{2}\right )} n^{2} + 2 \, {\left (B^{2} b^{2} c^{2} - 2 \, B^{2} a b c d + B^{2} a^{2} d^{2}\right )} \log \left (e\right )^{2} - 2 \, {\left (B^{2} b^{2} d^{2} n^{2} x^{2} + 2 \, B^{2} a b d^{2} n^{2} x - {\left (B^{2} b^{2} c^{2} - 2 \, B^{2} a b c d\right )} n^{2}\right )} \log \left (\frac {b x + a}{d x + c}\right )^{2} + 2 \, {\left (A B b^{2} c^{2} - 4 \, A B a b c d + 3 \, A B a^{2} d^{2}\right )} n - 2 \, {\left (3 \, {\left (B^{2} b^{2} c d - B^{2} a b d^{2}\right )} n^{2} + 2 \, {\left (A B b^{2} c d - A B a b d^{2}\right )} n\right )} x + 2 \, {\left (2 \, A B b^{2} c^{2} - 4 \, A B a b c d + 2 \, A B a^{2} d^{2} - 2 \, {\left (B^{2} b^{2} c d - B^{2} a b d^{2}\right )} n x + {\left (B^{2} b^{2} c^{2} - 4 \, B^{2} a b c d + 3 \, B^{2} a^{2} d^{2}\right )} n - 2 \, {\left (B^{2} b^{2} d^{2} n x^{2} + 2 \, B^{2} a b d^{2} n x - {\left (B^{2} b^{2} c^{2} - 2 \, B^{2} a b c d\right )} n\right )} \log \left (\frac {b x + a}{d x + c}\right )\right )} \log \left (e\right ) + 2 \, {\left ({\left (B^{2} b^{2} c^{2} - 4 \, B^{2} a b c d\right )} n^{2} - {\left (3 \, B^{2} b^{2} d^{2} n^{2} + 2 \, A B b^{2} d^{2} n\right )} x^{2} + 2 \, {\left (A B b^{2} c^{2} - 2 \, A B a b c d\right )} n - 2 \, {\left (2 \, A B a b d^{2} n + {\left (B^{2} b^{2} c d + 2 \, B^{2} a b d^{2}\right )} n^{2}\right )} x\right )} \log \left (\frac {b x + a}{d x + c}\right )}{4 \, {\left ({\left (b^{5} c^{2} - 2 \, a b^{4} c d + a^{2} b^{3} d^{2}\right )} g^{3} x^{2} + 2 \, {\left (a b^{4} c^{2} - 2 \, a^{2} b^{3} c d + a^{3} b^{2} d^{2}\right )} g^{3} x + {\left (a^{2} b^{3} c^{2} - 2 \, a^{3} b^{2} c d + a^{4} b d^{2}\right )} g^{3}\right )}} \]

[In]

integrate((A+B*log(e*((b*x+a)/(d*x+c))^n))^2/(b*g*x+a*g)^3,x, algorithm="fricas")

[Out]

-1/4*(2*A^2*b^2*c^2 - 4*A^2*a*b*c*d + 2*A^2*a^2*d^2 + (B^2*b^2*c^2 - 8*B^2*a*b*c*d + 7*B^2*a^2*d^2)*n^2 + 2*(B
^2*b^2*c^2 - 2*B^2*a*b*c*d + B^2*a^2*d^2)*log(e)^2 - 2*(B^2*b^2*d^2*n^2*x^2 + 2*B^2*a*b*d^2*n^2*x - (B^2*b^2*c
^2 - 2*B^2*a*b*c*d)*n^2)*log((b*x + a)/(d*x + c))^2 + 2*(A*B*b^2*c^2 - 4*A*B*a*b*c*d + 3*A*B*a^2*d^2)*n - 2*(3
*(B^2*b^2*c*d - B^2*a*b*d^2)*n^2 + 2*(A*B*b^2*c*d - A*B*a*b*d^2)*n)*x + 2*(2*A*B*b^2*c^2 - 4*A*B*a*b*c*d + 2*A
*B*a^2*d^2 - 2*(B^2*b^2*c*d - B^2*a*b*d^2)*n*x + (B^2*b^2*c^2 - 4*B^2*a*b*c*d + 3*B^2*a^2*d^2)*n - 2*(B^2*b^2*
d^2*n*x^2 + 2*B^2*a*b*d^2*n*x - (B^2*b^2*c^2 - 2*B^2*a*b*c*d)*n)*log((b*x + a)/(d*x + c)))*log(e) + 2*((B^2*b^
2*c^2 - 4*B^2*a*b*c*d)*n^2 - (3*B^2*b^2*d^2*n^2 + 2*A*B*b^2*d^2*n)*x^2 + 2*(A*B*b^2*c^2 - 2*A*B*a*b*c*d)*n - 2
*(2*A*B*a*b*d^2*n + (B^2*b^2*c*d + 2*B^2*a*b*d^2)*n^2)*x)*log((b*x + a)/(d*x + c)))/((b^5*c^2 - 2*a*b^4*c*d +
a^2*b^3*d^2)*g^3*x^2 + 2*(a*b^4*c^2 - 2*a^2*b^3*c*d + a^3*b^2*d^2)*g^3*x + (a^2*b^3*c^2 - 2*a^3*b^2*c*d + a^4*
b*d^2)*g^3)

Sympy [F]

\[ \int \frac {\left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )^2}{(a g+b g x)^3} \, dx=\frac {\int \frac {A^{2}}{a^{3} + 3 a^{2} b x + 3 a b^{2} x^{2} + b^{3} x^{3}}\, dx + \int \frac {B^{2} \log {\left (e \left (\frac {a}{c + d x} + \frac {b x}{c + d x}\right )^{n} \right )}^{2}}{a^{3} + 3 a^{2} b x + 3 a b^{2} x^{2} + b^{3} x^{3}}\, dx + \int \frac {2 A B \log {\left (e \left (\frac {a}{c + d x} + \frac {b x}{c + d x}\right )^{n} \right )}}{a^{3} + 3 a^{2} b x + 3 a b^{2} x^{2} + b^{3} x^{3}}\, dx}{g^{3}} \]

[In]

integrate((A+B*ln(e*((b*x+a)/(d*x+c))**n))**2/(b*g*x+a*g)**3,x)

[Out]

(Integral(A**2/(a**3 + 3*a**2*b*x + 3*a*b**2*x**2 + b**3*x**3), x) + Integral(B**2*log(e*(a/(c + d*x) + b*x/(c
 + d*x))**n)**2/(a**3 + 3*a**2*b*x + 3*a*b**2*x**2 + b**3*x**3), x) + Integral(2*A*B*log(e*(a/(c + d*x) + b*x/
(c + d*x))**n)/(a**3 + 3*a**2*b*x + 3*a*b**2*x**2 + b**3*x**3), x))/g**3

Maxima [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 861 vs. \(2 (282) = 564\).

Time = 0.25 (sec) , antiderivative size = 861, normalized size of antiderivative = 2.99 \[ \int \frac {\left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )^2}{(a g+b g x)^3} \, dx=\frac {1}{2} \, A B n {\left (\frac {2 \, b d x - b c + 3 \, a d}{{\left (b^{4} c - a b^{3} d\right )} g^{3} x^{2} + 2 \, {\left (a b^{3} c - a^{2} b^{2} d\right )} g^{3} x + {\left (a^{2} b^{2} c - a^{3} b d\right )} g^{3}} + \frac {2 \, d^{2} \log \left (b x + a\right )}{{\left (b^{3} c^{2} - 2 \, a b^{2} c d + a^{2} b d^{2}\right )} g^{3}} - \frac {2 \, d^{2} \log \left (d x + c\right )}{{\left (b^{3} c^{2} - 2 \, a b^{2} c d + a^{2} b d^{2}\right )} g^{3}}\right )} + \frac {1}{4} \, {\left (2 \, n {\left (\frac {2 \, b d x - b c + 3 \, a d}{{\left (b^{4} c - a b^{3} d\right )} g^{3} x^{2} + 2 \, {\left (a b^{3} c - a^{2} b^{2} d\right )} g^{3} x + {\left (a^{2} b^{2} c - a^{3} b d\right )} g^{3}} + \frac {2 \, d^{2} \log \left (b x + a\right )}{{\left (b^{3} c^{2} - 2 \, a b^{2} c d + a^{2} b d^{2}\right )} g^{3}} - \frac {2 \, d^{2} \log \left (d x + c\right )}{{\left (b^{3} c^{2} - 2 \, a b^{2} c d + a^{2} b d^{2}\right )} g^{3}}\right )} \log \left (e {\left (\frac {b x}{d x + c} + \frac {a}{d x + c}\right )}^{n}\right ) - \frac {{\left (b^{2} c^{2} - 8 \, a b c d + 7 \, a^{2} d^{2} + 2 \, {\left (b^{2} d^{2} x^{2} + 2 \, a b d^{2} x + a^{2} d^{2}\right )} \log \left (b x + a\right )^{2} + 2 \, {\left (b^{2} d^{2} x^{2} + 2 \, a b d^{2} x + a^{2} d^{2}\right )} \log \left (d x + c\right )^{2} - 6 \, {\left (b^{2} c d - a b d^{2}\right )} x - 6 \, {\left (b^{2} d^{2} x^{2} + 2 \, a b d^{2} x + a^{2} d^{2}\right )} \log \left (b x + a\right ) + 2 \, {\left (3 \, b^{2} d^{2} x^{2} + 6 \, a b d^{2} x + 3 \, a^{2} d^{2} - 2 \, {\left (b^{2} d^{2} x^{2} + 2 \, a b d^{2} x + a^{2} d^{2}\right )} \log \left (b x + a\right )\right )} \log \left (d x + c\right )\right )} n^{2}}{a^{2} b^{3} c^{2} g^{3} - 2 \, a^{3} b^{2} c d g^{3} + a^{4} b d^{2} g^{3} + {\left (b^{5} c^{2} g^{3} - 2 \, a b^{4} c d g^{3} + a^{2} b^{3} d^{2} g^{3}\right )} x^{2} + 2 \, {\left (a b^{4} c^{2} g^{3} - 2 \, a^{2} b^{3} c d g^{3} + a^{3} b^{2} d^{2} g^{3}\right )} x}\right )} B^{2} - \frac {B^{2} \log \left (e {\left (\frac {b x}{d x + c} + \frac {a}{d x + c}\right )}^{n}\right )^{2}}{2 \, {\left (b^{3} g^{3} x^{2} + 2 \, a b^{2} g^{3} x + a^{2} b g^{3}\right )}} - \frac {A B \log \left (e {\left (\frac {b x}{d x + c} + \frac {a}{d x + c}\right )}^{n}\right )}{b^{3} g^{3} x^{2} + 2 \, a b^{2} g^{3} x + a^{2} b g^{3}} - \frac {A^{2}}{2 \, {\left (b^{3} g^{3} x^{2} + 2 \, a b^{2} g^{3} x + a^{2} b g^{3}\right )}} \]

[In]

integrate((A+B*log(e*((b*x+a)/(d*x+c))^n))^2/(b*g*x+a*g)^3,x, algorithm="maxima")

[Out]

1/2*A*B*n*((2*b*d*x - b*c + 3*a*d)/((b^4*c - a*b^3*d)*g^3*x^2 + 2*(a*b^3*c - a^2*b^2*d)*g^3*x + (a^2*b^2*c - a
^3*b*d)*g^3) + 2*d^2*log(b*x + a)/((b^3*c^2 - 2*a*b^2*c*d + a^2*b*d^2)*g^3) - 2*d^2*log(d*x + c)/((b^3*c^2 - 2
*a*b^2*c*d + a^2*b*d^2)*g^3)) + 1/4*(2*n*((2*b*d*x - b*c + 3*a*d)/((b^4*c - a*b^3*d)*g^3*x^2 + 2*(a*b^3*c - a^
2*b^2*d)*g^3*x + (a^2*b^2*c - a^3*b*d)*g^3) + 2*d^2*log(b*x + a)/((b^3*c^2 - 2*a*b^2*c*d + a^2*b*d^2)*g^3) - 2
*d^2*log(d*x + c)/((b^3*c^2 - 2*a*b^2*c*d + a^2*b*d^2)*g^3))*log(e*(b*x/(d*x + c) + a/(d*x + c))^n) - (b^2*c^2
 - 8*a*b*c*d + 7*a^2*d^2 + 2*(b^2*d^2*x^2 + 2*a*b*d^2*x + a^2*d^2)*log(b*x + a)^2 + 2*(b^2*d^2*x^2 + 2*a*b*d^2
*x + a^2*d^2)*log(d*x + c)^2 - 6*(b^2*c*d - a*b*d^2)*x - 6*(b^2*d^2*x^2 + 2*a*b*d^2*x + a^2*d^2)*log(b*x + a)
+ 2*(3*b^2*d^2*x^2 + 6*a*b*d^2*x + 3*a^2*d^2 - 2*(b^2*d^2*x^2 + 2*a*b*d^2*x + a^2*d^2)*log(b*x + a))*log(d*x +
 c))*n^2/(a^2*b^3*c^2*g^3 - 2*a^3*b^2*c*d*g^3 + a^4*b*d^2*g^3 + (b^5*c^2*g^3 - 2*a*b^4*c*d*g^3 + a^2*b^3*d^2*g
^3)*x^2 + 2*(a*b^4*c^2*g^3 - 2*a^2*b^3*c*d*g^3 + a^3*b^2*d^2*g^3)*x))*B^2 - 1/2*B^2*log(e*(b*x/(d*x + c) + a/(
d*x + c))^n)^2/(b^3*g^3*x^2 + 2*a*b^2*g^3*x + a^2*b*g^3) - A*B*log(e*(b*x/(d*x + c) + a/(d*x + c))^n)/(b^3*g^3
*x^2 + 2*a*b^2*g^3*x + a^2*b*g^3) - 1/2*A^2/(b^3*g^3*x^2 + 2*a*b^2*g^3*x + a^2*b*g^3)

Giac [A] (verification not implemented)

none

Time = 1.04 (sec) , antiderivative size = 478, normalized size of antiderivative = 1.66 \[ \int \frac {\left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )^2}{(a g+b g x)^3} \, dx=-\frac {1}{4} \, {\left (\frac {2 \, {\left (B^{2} b n^{2} - \frac {2 \, {\left (b x + a\right )} B^{2} d n^{2}}{d x + c}\right )} \log \left (\frac {b x + a}{d x + c}\right )^{2}}{\frac {{\left (b x + a\right )}^{2} b c g^{3}}{{\left (d x + c\right )}^{2}} - \frac {{\left (b x + a\right )}^{2} a d g^{3}}{{\left (d x + c\right )}^{2}}} + \frac {2 \, {\left (B^{2} b n^{2} - \frac {4 \, {\left (b x + a\right )} B^{2} d n^{2}}{d x + c} + 2 \, B^{2} b n \log \left (e\right ) - \frac {4 \, {\left (b x + a\right )} B^{2} d n \log \left (e\right )}{d x + c} + 2 \, A B b n - \frac {4 \, {\left (b x + a\right )} A B d n}{d x + c}\right )} \log \left (\frac {b x + a}{d x + c}\right )}{\frac {{\left (b x + a\right )}^{2} b c g^{3}}{{\left (d x + c\right )}^{2}} - \frac {{\left (b x + a\right )}^{2} a d g^{3}}{{\left (d x + c\right )}^{2}}} + \frac {B^{2} b n^{2} - \frac {8 \, {\left (b x + a\right )} B^{2} d n^{2}}{d x + c} + 2 \, B^{2} b n \log \left (e\right ) - \frac {8 \, {\left (b x + a\right )} B^{2} d n \log \left (e\right )}{d x + c} + 2 \, B^{2} b \log \left (e\right )^{2} - \frac {4 \, {\left (b x + a\right )} B^{2} d \log \left (e\right )^{2}}{d x + c} + 2 \, A B b n - \frac {8 \, {\left (b x + a\right )} A B d n}{d x + c} + 4 \, A B b \log \left (e\right ) - \frac {8 \, {\left (b x + a\right )} A B d \log \left (e\right )}{d x + c} + 2 \, A^{2} b - \frac {4 \, {\left (b x + a\right )} A^{2} d}{d x + c}}{\frac {{\left (b x + a\right )}^{2} b c g^{3}}{{\left (d x + c\right )}^{2}} - \frac {{\left (b x + a\right )}^{2} a d g^{3}}{{\left (d x + c\right )}^{2}}}\right )} {\left (\frac {b c}{{\left (b c - a d\right )}^{2}} - \frac {a d}{{\left (b c - a d\right )}^{2}}\right )} \]

[In]

integrate((A+B*log(e*((b*x+a)/(d*x+c))^n))^2/(b*g*x+a*g)^3,x, algorithm="giac")

[Out]

-1/4*(2*(B^2*b*n^2 - 2*(b*x + a)*B^2*d*n^2/(d*x + c))*log((b*x + a)/(d*x + c))^2/((b*x + a)^2*b*c*g^3/(d*x + c
)^2 - (b*x + a)^2*a*d*g^3/(d*x + c)^2) + 2*(B^2*b*n^2 - 4*(b*x + a)*B^2*d*n^2/(d*x + c) + 2*B^2*b*n*log(e) - 4
*(b*x + a)*B^2*d*n*log(e)/(d*x + c) + 2*A*B*b*n - 4*(b*x + a)*A*B*d*n/(d*x + c))*log((b*x + a)/(d*x + c))/((b*
x + a)^2*b*c*g^3/(d*x + c)^2 - (b*x + a)^2*a*d*g^3/(d*x + c)^2) + (B^2*b*n^2 - 8*(b*x + a)*B^2*d*n^2/(d*x + c)
 + 2*B^2*b*n*log(e) - 8*(b*x + a)*B^2*d*n*log(e)/(d*x + c) + 2*B^2*b*log(e)^2 - 4*(b*x + a)*B^2*d*log(e)^2/(d*
x + c) + 2*A*B*b*n - 8*(b*x + a)*A*B*d*n/(d*x + c) + 4*A*B*b*log(e) - 8*(b*x + a)*A*B*d*log(e)/(d*x + c) + 2*A
^2*b - 4*(b*x + a)*A^2*d/(d*x + c))/((b*x + a)^2*b*c*g^3/(d*x + c)^2 - (b*x + a)^2*a*d*g^3/(d*x + c)^2))*(b*c/
(b*c - a*d)^2 - a*d/(b*c - a*d)^2)

Mupad [B] (verification not implemented)

Time = 3.08 (sec) , antiderivative size = 506, normalized size of antiderivative = 1.76 \[ \int \frac {\left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )^2}{(a g+b g x)^3} \, dx=-{\ln \left (e\,{\left (\frac {a+b\,x}{c+d\,x}\right )}^n\right )}^2\,\left (\frac {B^2}{2\,b\,\left (a^2\,g^3+2\,a\,b\,g^3\,x+b^2\,g^3\,x^2\right )}-\frac {B^2\,d^2}{2\,b\,g^3\,\left (a^2\,d^2-2\,a\,b\,c\,d+b^2\,c^2\right )}\right )-\frac {\frac {2\,A^2\,a\,d-2\,A^2\,b\,c+7\,B^2\,a\,d\,n^2-B^2\,b\,c\,n^2+6\,A\,B\,a\,d\,n-2\,A\,B\,b\,c\,n}{2\,\left (a\,d-b\,c\right )}+\frac {d\,x\,\left (3\,b\,B^2\,n^2+2\,A\,b\,B\,n\right )}{a\,d-b\,c}}{2\,a^2\,b\,g^3+4\,a\,b^2\,g^3\,x+2\,b^3\,g^3\,x^2}-\ln \left (e\,{\left (\frac {a+b\,x}{c+d\,x}\right )}^n\right )\,\left (\frac {A\,B}{a^2\,b\,g^3+2\,a\,b^2\,g^3\,x+b^3\,g^3\,x^2}+\frac {B^2\,d^2\,\left (\frac {b\,g^3\,n\,\left (a\,d-b\,c\right )\,\left (2\,a\,d-b\,c\right )}{2\,d^2}+\frac {b^2\,g^3\,n\,x\,\left (a\,d-b\,c\right )}{d}+\frac {a\,b\,g^3\,n\,\left (a\,d-b\,c\right )}{2\,d}\right )}{b\,g^3\,\left (a^2\,d^2-2\,a\,b\,c\,d+b^2\,c^2\right )\,\left (a^2\,b\,g^3+2\,a\,b^2\,g^3\,x+b^3\,g^3\,x^2\right )}\right )-\frac {B\,d^2\,n\,\mathrm {atan}\left (\frac {\left (2\,b\,d\,x-\frac {2\,b^3\,c^2\,g^3-2\,a^2\,b\,d^2\,g^3}{2\,b\,g^3\,\left (a\,d-b\,c\right )}\right )\,1{}\mathrm {i}}{a\,d-b\,c}\right )\,\left (2\,A+3\,B\,n\right )\,1{}\mathrm {i}}{b\,g^3\,{\left (a\,d-b\,c\right )}^2} \]

[In]

int((A + B*log(e*((a + b*x)/(c + d*x))^n))^2/(a*g + b*g*x)^3,x)

[Out]

- log(e*((a + b*x)/(c + d*x))^n)^2*(B^2/(2*b*(a^2*g^3 + b^2*g^3*x^2 + 2*a*b*g^3*x)) - (B^2*d^2)/(2*b*g^3*(a^2*
d^2 + b^2*c^2 - 2*a*b*c*d))) - ((2*A^2*a*d - 2*A^2*b*c + 7*B^2*a*d*n^2 - B^2*b*c*n^2 + 6*A*B*a*d*n - 2*A*B*b*c
*n)/(2*(a*d - b*c)) + (d*x*(3*B^2*b*n^2 + 2*A*B*b*n))/(a*d - b*c))/(2*a^2*b*g^3 + 2*b^3*g^3*x^2 + 4*a*b^2*g^3*
x) - log(e*((a + b*x)/(c + d*x))^n)*((A*B)/(a^2*b*g^3 + b^3*g^3*x^2 + 2*a*b^2*g^3*x) + (B^2*d^2*((b*g^3*n*(a*d
 - b*c)*(2*a*d - b*c))/(2*d^2) + (b^2*g^3*n*x*(a*d - b*c))/d + (a*b*g^3*n*(a*d - b*c))/(2*d)))/(b*g^3*(a^2*d^2
 + b^2*c^2 - 2*a*b*c*d)*(a^2*b*g^3 + b^3*g^3*x^2 + 2*a*b^2*g^3*x))) - (B*d^2*n*atan(((2*b*d*x - (2*b^3*c^2*g^3
 - 2*a^2*b*d^2*g^3)/(2*b*g^3*(a*d - b*c)))*1i)/(a*d - b*c))*(2*A + 3*B*n)*1i)/(b*g^3*(a*d - b*c)^2)